<?php
/**
 * Created by mFramework.
 * User: Mauro
 * Date: 29/04/11
 * Time: 11:06
 */

class usuariosCMS extends CMS {
	public $model = 'MFUser';
	public $module = 'usuarios';
	
	function __construct($view = null) {
		parent::__construct($view);
	}

    function executeSave() {
        unset($_POST['confirm_password']);
        parent::executeSave(true);
    }

    function executeCheckEmail() {
        $user = Doctrine::getTable('MFUser')->findByEmail($_POST['email']);
        $bool = $user->toArray();
        if(!empty($bool))
            echo 'Email ya registrado!';
    }

    function executeIndex() {
        $list = $this->listModel($this->model);
        $list = $this->deleteFieldFromList('password',$list);
        $list = $this->deleteFieldFromList('token',$list);
        parent::executeIndex($list);
    }
}
?>